package com.example.createspringbootdemo;

import javafx.application.Application;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.boot.web.server.ConfigurableWebServerFactory;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
public class CreateSpringbootDemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(CreateSpringbootDemoApplication.class, args);
    }
    @RestController
    static class  HelloWorldController{
        @RequestMapping("hello")
        String index(){
            return "你好，Srping Boot";
        }

    }
    @Bean("initer")
    public CommandLineRunner commandLineRunner(ApplicationContext ctx){
        return args -> {
            System.out.println("这是commandLineRunner");
        };
    }

}
